package com.wxl.common.util

import android.content.Context
import android.graphics.Color
import com.lljjcoder.citypickerview.widget.CityPicker

/**
 * create file time : 2021/3/19
 * create user : wxl
 * subscribe :
 */
class AdrPicker {

    companion object {
        fun selectDistrict(context: Context,l:CityPicker.OnCityItemClickListener){
            val cityPicker: CityPicker = CityPicker.Builder(context)
                .textSize(14)
                .title("地址选择")
                .titleBackgroundColor("#FFFFFF")
                .confirTextColor("#696969")
                .cancelTextColor("#696969")
                .province("贵州省")
                .city("黔南布依族苗族自治州")
                .district("独山县")
                .textColor(Color.parseColor("#000000"))
                .provinceCyclic(true)
                .cityCyclic(false)
                .districtCyclic(false)
                .visibleItemsCount(7)
                .itemPadding(10)
                .onlyShowProvinceAndCity(false)
                .build()
            cityPicker.show()
            cityPicker.setOnCityItemClickListener(l)
        }

        fun selectCity(context: Context,l:CityPicker.OnCityItemClickListener){
            val cityPicker: CityPicker = CityPicker.Builder(context)
                .textSize(14)
                .title("地址选择")
                .titleBackgroundColor("#FFFFFF")
                .confirTextColor("#696969")
                .cancelTextColor("#696969")
                .province("贵州省")
                .city("黔南布依族苗族自治州")
                .district("独山县")
                .textColor(Color.parseColor("#000000"))
                .provinceCyclic(true)
                .cityCyclic(true)
                .districtCyclic(false)
                .visibleItemsCount(7)
                .itemPadding(10)
                .onlyShowProvinceAndCity(true)
                .build()
            cityPicker.show()
            cityPicker.setOnCityItemClickListener(l)
        }
    }
}